package com.noreg.timmer;

import java.util.List;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

import com.mover.util.BeanUtil;
import com.noreg.interfaces.IParser;

/**
 * @author Jeson
 * @blog:http://www.ij2ee.com
 * @date:2011-4-16 上午10:16:06
 * @version :1.0
 * 
 */
public class ParserJob extends QuartzJobBean {
	protected void executeInternal(JobExecutionContext arg0)
			throws JobExecutionException {
		
		try {
			
			TaskList list = (TaskList) BeanUtil.getBean("taskListBean");
			
			if(list!=null){
				List<IParser> cps =  list.getTaskList();
				for(IParser cp :cps){
					cp.start();
				}
			}
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
}
